/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package EntidadesDBPrueba;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Facundo
 */
@Embeddable
public class PersonaPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 20)
    @Column(name = "nombreTipoDoc", nullable = false, length = 20)
    private String nombreTipoDoc;
    @Basic(optional = false)
    @NotNull
    @Column(name = "nroDoc", nullable = false)
    private int nroDoc;

    public PersonaPK() {
    }

    public PersonaPK(String nombreTipoDoc, int nroDoc) {
        this.nombreTipoDoc = nombreTipoDoc;
        this.nroDoc = nroDoc;
    }

    public String getNombreTipoDoc() {
        return nombreTipoDoc;
    }

    public void setNombreTipoDoc(String nombreTipoDoc) {
        this.nombreTipoDoc = nombreTipoDoc;
    }

    public int getNroDoc() {
        return nroDoc;
    }

    public void setNroDoc(int nroDoc) {
        this.nroDoc = nroDoc;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nombreTipoDoc != null ? nombreTipoDoc.hashCode() : 0);
        hash += (int) nroDoc;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PersonaPK)) {
            return false;
        }
        PersonaPK other = (PersonaPK) object;
        if ((this.nombreTipoDoc == null && other.nombreTipoDoc != null) || (this.nombreTipoDoc != null && !this.nombreTipoDoc.equals(other.nombreTipoDoc))) {
            return false;
        }
        if (this.nroDoc != other.nroDoc) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "EntidadesDBPrueba.PersonaPK[ nombreTipoDoc=" + nombreTipoDoc + ", nroDoc=" + nroDoc + " ]";
    }
    
}
